import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch((err) => err);
};

const router = new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/",
      component: () => import("@/views/home"),
      mete: { title: "推荐" },
      children: [
        {
          path: "/",
          name: "tuijian",
          component: () => import("@/views/home/XmlyRecommend"),
        },
        {
          path: "/home/youshengshu",
          name: "youshengshu",
          component: () => import("@/views/home/youshengshu"),
        },
      ],
    },

    {
      path: "/rank",
      name: "rank",
      component: () => import("@/views/rank"),
    },
    {
      path: "/channel",
      name: "channel",
      component: () => import("@/views/channel"),
    },
  ],
});

export default router;
